﻿Imports Alquilaqi
Public Class AgregarDueñoInmueble

    Public inmuebleAgregar As InmuebleAgregar


    Private Sub Buscar1bt_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Buscar1bt.Click

        Dim criterio As String = Me.buscarT.Text
        'MsgBox(criterio)

        Dim negocio As New DueñoNegocio
        Dim apellidoP As Collection = negocio.buscarPorNombre(criterio)
        Me.dgdueño.DataSource = apellidoP
        Me.dgdueño.EditMode = False

        If apellidoP.Count > 0 Then
            Me.dgdueño.Columns(0).HeaderText = "Id"
            Me.dgdueño.Columns(1).HeaderText = "Nombre"
            Me.dgdueño.Columns(2).HeaderText = "Apellido P."
            Me.dgdueño.Columns(3).HeaderText = "Apellido M."
            Me.dgdueño.Columns(4).Visible = False
            Me.dgdueño.Columns(5).Visible = False
            Me.dgdueño.Columns(6).Visible = False
            Me.dgdueño.Columns(7).Visible = False
            Me.dgdueño.Columns(8).HeaderText = "DNI"
        End If
        With Me.dgdueño.ColumnHeadersDefaultCellStyle
            .BackColor = Color.Red
            .ForeColor = Color.White
        End With

    End Sub

    Private Sub Seleccionar1bt_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Seleccionar1bt.Click
        Dim seleccionado = Me.dgdueño.CurrentRow.Cells(0).Value.ToString
        Me.inmuebleAgregar.iddueñoM.Text = seleccionado
        Me.Close()

        'Dim form As New InmuebleAgregar
        'Me..iddueñoM .Text = seleccionado
        'form.agregardueñoi = Me
        'form.Show()
    End Sub

    Private Sub AgregarDueñoInmueble_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    End Sub
End Class